package com.example.demo.dao;


import com.example.demo.model.Userinfo;
import com.example.demo.model.vo.UserinfoVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @Insert("insert into userinfo(username,password) values (#{username},#{password})")
    int reg(Userinfo userinfo);

    @Select("select * from userinfo where username = #{username}")
    UserinfoVo getUserByName(String name);

    @Select("select * from userinfo where id = #{uid}")
    UserinfoVo getUserById(@Param("uid") int uid);
}
